package com.pai4j.remote.search;

import com.pai4j.common.bean.PAIPageResponseBeanUtil;
import com.pai4j.common.bean.PAIResponseBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "pai4j-search-service", contextId = "searchEngineClient")
public interface SearchEngineClient {

    @GetMapping("/search-service/content/query")
    PAIPageResponseBeanUtil query(@RequestParam(value = "q", required = false) String query,
                                  @RequestParam(value = "type", required = false) Integer type,
                                  @RequestParam(value = "userId", required = false) String userId,
                                  @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
                                  @RequestParam(value = "size", required = false, defaultValue = "10") Integer size);



    /**
     *  创建索引
     **/
    @GetMapping("/search-service/content/createIndex")
    PAIResponseBean<Boolean> createChatMessageIndex();


    /**
     *  删除索引
     **/
    @GetMapping("/search-service/content/deleteIndex")
    PAIResponseBean<Boolean> deleteIndex();
}